<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ');
  }
mysql_select_db("test", $con);

$temp="SELECT user FROM users";
	$sql=mysql_query($temp);
	while($row=mysql_fetch_array($sql))
	{
		$temptext=$row['user'];
		$temp1="UPDATE users SET users.online=0,users.typing=0 WHERE users.user='$temptext'";
		$sql1=mysql_query($temp1);
		sleep(300);
	}
?>